package edu.whu.rose.clock.kps.algorithm.blinks2.binding;

import com.sleepycat.bind.tuple.TupleBinding;
import com.sleepycat.bind.tuple.TupleInput;
import com.sleepycat.bind.tuple.TupleOutput;

import edu.whu.rose.clock.kps.algorithm.blinks2.index.NKEntry2;

public class NKMapBinding2 extends TupleBinding {

	public Object entryToObject(TupleInput input) {
		short distance = input.readShort();
		int knode = input.readInt();
		int first = input.readInt();
		NKEntry2 nke = new NKEntry2(distance, knode, first);
		return nke;
	}
	
	public void objectToEntry(Object object, TupleOutput output) {
		NKEntry2 nke = (NKEntry2)object;
		output.writeShort(nke.getDistance());
		output.writeInt(nke.getKnode());
		output.writeInt(nke.getFirst());
	}

}
